package light.head.model.el;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.Formula;
/**
 * 讲师表
 */
@Table
@Entity
public class Lecturer implements Serializable{
	
	private static final long serialVersionUID = 2231458389144034005L;
	private Integer code;			//讲师编号
	private String ln;				//讲师名称
	private String major;			//主修专业
	private Boolean deleted = false;		//是否删除
	private Integer oc;
	private Integer cu;
	private Date ct;
	private String cn;
	private String on;
	
	
	@Id
	@Column
	public Integer getCode() {
		return code;
	}
	@Column
	public String getLn() {
		return ln;
	}
	@Column
	public String getMajor() {
		return major;
	}
	@Column
	public Boolean getDeleted() {
		return deleted;
	}
	@Column
	public Date getCt() {
		return ct;
	}
	@Column
	public Integer getOc() {
		return oc;
	}
	@Column
	public Integer getCu() {
		return cu;
	}
	@Formula("(SELECT u.realName FROM UserInfo u WHERE u.code=cu)")
	public String getCn() {
		return cn;
	}
	@Formula("(SELECT o.name FROM Organ o WHERE o.code=oc)")
	public String getOn() {
		return on;
	}
	
	
	
	
	
	
	public void setCt(Date ct) {
		this.ct = ct;
	}
	public void setCode(Integer code) {
		this.code = code;
	}
	public void setLn(String ln) {
		this.ln = ln;
	}
	public void setMajor(String major) {
		this.major = major;
	}
	public void setDeleted(Boolean deleted) {
		this.deleted = deleted;
	}
	public void setOc(Integer oc) {
		this.oc = oc;
	}
	public void setCu(Integer cu) {
		this.cu = cu;
	}
	public void setCn(String cn) {
		this.cn = cn;
	}
	public void setOn(String on) {
		this.on = on;
	}
	
	

}
